import { NAV_PROVIDE_KEY } from './pages/fragments/nav';
import { createApp, ref } from 'vue';
import App from './App.vue';
import router from './router/router';
import ElementPlus from 'element-plus';
import { installApi } from './core/http/api-instance';

// css
import 'animate.less/animate.css';
import '@assets/css/element-variables.scss';
import '@assets/css/common.scss';
import 'vxe-table/lib/style.css';
import zhCn from 'element-plus/es/locale/lang/zh-cn';

// components
import { installDirectives } from '@pages/directives';
import CKEditor from '@ckeditor/ckeditor5-vue';
import piniaStore from '@core/pinia';
import '@ckeditor/ckeditor5-build-classic/build/translations/zh-cn';

createApp(App)
  .use(piniaStore)
  .use(router)
  .use(CKEditor)
  .use(installDirectives)
  .use(ElementPlus, {
    size: 'large',
    locale: zhCn,
  })
  .provide(NAV_PROVIDE_KEY, {
    title: ref(),
    toSearch: undefined,
  })
  .use(installApi)
  .mount('#app');
